package com.ruoyi.redtea.dualprevent.service;

import com.ruoyi.redtea.dualprevent.domain.entity.TrainTroubleRectify;
import com.ruoyi.redtea.dualprevent.domain.vo.TrainTroubleList;
import org.springframework.transaction.annotation.Transactional;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
* @author lgp
* @description 针对表【train_trouble_rectify(隐患整改，由隐患排查项上报而来，既是任务整改本体也充当流程节点“上报”)】的数据库操作Service
* @createDate 2024-05-16 10:29:48
*/
public interface TrainTroubleRectifyService {

    List<TrainTroubleList> queryTroubleList();


    Map<String,Object> queryStepInfoById(Integer id,Integer step);

    /**
     * 插入隐患整改
     * @return
     */
    boolean insertTroubleRectify(TrainTroubleRectify trainTroubleRectify);

    /**
     * 更新隐患整改
     * @param trainTroubleRectify
     * @return
     */
    boolean updateTroubleRectifyById(TrainTroubleRectify trainTroubleRectify);

    /**
     * 更新整改流程
     * @param flowStep
     * @param params
     * @param addOrUpdate true：add  false：update
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    boolean insertOrUpdateRectifyProcess(Integer flowStep, Object params,boolean addOrUpdate);
}
